home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / protocol / standard / mail / qwk_form / text0000.txt < prev   
Encoding:
Text File  |  1993-07-14  |  13.8 KB  |  352 lines

  1. Here is the spec for the .QWK format. Hopefully this info will prove
  2. useful to someone writing a QWK reader for UNIX. 
  3.  
  4.  
  5.                      IMMMMMMMMMMMMMMMMMMMMMMMMMMMM;
  6.                      : The QWK Mail Packet Format :
  7.                      HMMMMMMMMMMMMMMMMMMMMMMMMMMMM<
  8.  
  9. BBS ID
  10. DDDDDD
  11.  
  12.     The BBS ID is a 1-8 characters string that identifies a BBS' mail
  13.     packet.  The filename of the mail packet is often the BBS ID.
  14.     However, this is not always the case, so do not rely on that to
  15.     determine the BBS ID.  Instead, it is included on the fifth line of
  16.     the CONTROL.DAT file (see below.)
  17.  
  18. Compression
  19. DDDDDDDDDDD
  20.  
  21.     Most mail packets are compressed when create by the mail door.  The
  22.     most common archiver is PKZIP, but others such as LHA is being used.
  23.     However, many current off-line reader programs do allow the user to
  24.     unarchive a mail packet before entering the reader program, so the
  25.     reader will not unarchive it again.  Upon exit, the reader will not
  26.     call the archiver to save it.  It is up to the user to archive the
  27.     replies.
  28.  
  29. MESSAGES.DAT
  30. DDDDDDDDDDDD
  31.  
  32.     The QWK file format is based on the PCBoard 12.0 message base
  33.     formats from Clark Development Corporation.
  34.  
  35.     All of the messages in a mail packet are contained in a single file
  36.     named MESSAGES.DAT.  The file's logical record length is 128 bytes.
  37.     The first record of MESSAGES.DAT always contains a copyright notice
  38.     saying "Produced by Qmail...Copyright (c) 1987 by Sparkware.  All
  39.     Rights Reserved".  Messages start in record 2 and use this format:
  40.  
  41.     Offset  Length  Description
  42.     ------  ------  ----------------------------------------------------
  43.       1       1     Message status flag
  44.                     ' ' = public, unread
  45.                     '-' = public, read
  46.                     '+' = private, unread
  47.                     '*' = private, read
  48.                     '~' = comment to Sysop, unread
  49.                     '`' = comment to Sysop, read
  50.                     '%' = password protected, unread (protect by sender)
  51.                     '^' = password protected, read (protect by sender)
  52.                     '!' = password protected, unread (protect by group
  53.                           password)
  54.                     '#' = password protected, read (protect by group
  55.                           password)
  56.                     '$' = password protected, addressed to all (protect
  57.                           by group password)
  58.       2       7     Message number (in ASCII)
  59.       9       8     Date (mm-dd-yy)
  60.      17       5     Time (24 hour hh:mm)
  61.      22      25     To (uppercase)
  62.      47      25     From (uppercase)
  63.      72      25     Subject of message
  64.      97      12     Password (usually space filled)
  65.     109       8     Reference message number (in ASCII)
  66.     117       6     Number of 128 byte blocks in message (counting the
  67.                     header, in ASCII)
  68.     123       1     Is message killed?  ASCII 225 is active, 226 is
  69.                     killed
  70.     124       2     Conference number (as long integer), 124 is the
  71.                     least significant, 125 is most
  72.     125       3     Not used (usually filled with space)
  73.  
  74.     The text of message continues in the next record.  You can find out
  75.     how many blocks make up one message by looking at the value of
  76.     "Number of 128 byte blocks".  Message text is delimited by a ASCII
  77.     227 (pi character) symbol between lines.
  78.  
  79. xxx.NDX
  80. DDDDDDD
  81.  
  82.     The xxx.NDX files contain record numbers that point into the
  83.     MESSAGES.DAT file for actual messages.  Each conference that
  84.     contains messages has its own "xxx.NDX" file.  The "xxx" is the
  85.     conference number for the index file.
  86.  
  87.     Each NDX file uses a five bytes logical record length and is
  88.     formatted to:
  89.  
  90.     Offset  Length  Description
  91.     ------  ------  ----------------------------------------------------
  92.       1       4     Record number pointing to corresponding message in
  93.                     MESSAGES.DAT.  This number is in the Microsoft MKS$
  94.                     BASIC format.
  95.       5       1     Conference number of the message.  This byte should
  96.                     not be used because it duplicates both the filename
  97.                     of the index file and the conference # in the
  98.                     header.  It is also one byte long, which cannot
  99.                     handle conferences over 255.
  100.  
  101.     The formula for converting X, a long integer in MKS$ format, to
  102.     MKSToNum, a binary integer, is:
  103.  
  104.     MKSToNum := ((X AND NOT $ff000000) OR $00800000)
  105.                 SHR (24 - ((x SHR 24) AND $7f));
  106.  
  107.     Or in Turbo Pascal:
  108.  
  109.     type
  110.         bsingle = array [0..3] of byte;
  111.  
  112.     { converts TP real to Microsoft 4 bytes single }
  113.  
  114.     procedure real_to_msb (preal : real; var b : bsingle);
  115.     var
  116.         r : array [0 .. 5] of byte absolute preal;
  117.     begin
  118.         b [3] := r [0];
  119.         move (r [3], b [0], 3);
  120.     end; { procedure real_to_msb }
  121.  
  122.     { converts Microsoft 4 bytes single to TP real }
  123.  
  124.     function msb_to_real(b : bsingle) : real;
  125.     var
  126.         preal : real;
  127.         r : array [0..5] of byte absolute preal;
  128.     begin
  129.         r [0] := b [3];
  130.         r [1] := 0;
  131.         r [2] := 0;
  132.         move (b [0], r [3], 3);
  133.         msb_to_real := preal;
  134.     end; { procedure msb_to_real }
  135.  
  136.     There is a special index file named PERSONAL.NDX.  This file
  137.     contains pointers to messages which are addressed to the user, i.e.
  138.     personal messages.  Some mail door and utility programs also allow
  139.     the selection of other messages to be flagged as personal messages
  140.     as well.
  141.  
  142. CONTROL.DAT
  143. DDDDDDDDDDD
  144.  
  145.     The CONTROL.DAT file is a simple ASCII file.
  146.  
  147.     Aardvark BBS                    BBS long name
  148.     New York, NY                    BBS city and state
  149.     212-496-8324                    BBS number
  150.     David Greenberger, Sysop        BBS Sysop name
  151.     20052,AARDVARK                  Mail door registeration #, BBS ID
  152.     10-19-1990,00:36:13             Packet creation time
  153.     PATRICK LEE                     User name
  154.                                     Name of menu for Qmail, if exists
  155.     0                               ?
  156.     0                               ?
  157.     121                             Total number of conf. minus 1
  158.     0                               1st conference number
  159.     Main Board                      1st conference name
  160.     1                               2nd conference number
  161.     General                         2nd conference name
  162.     3                               etc. onward until it hits max. conf.
  163.     123                             Last conference number
  164.     Amiga_I                         Last conference name
  165.     HELLO                           Welcome screen file
  166.     NEWS                            BBS news file
  167.     SCRIPT0                         Log off screen
  168.  
  169.     [ Some mail doors do not send the information below here. ]
  170.  
  171.     0                               ?
  172.     25                              ?
  173.     PATRICK LEE                     User name in uppercase
  174.     Patrick                         User first name
  175.     ELMHURST, NEW YORK              User city, state
  176.      718 639-6696                   User data phone
  177.      718 639-6696                   User home phone
  178.     108                             Security level
  179.     00-00-00                        Expiration date
  180.     10-17-90                        Last log on date
  181.     23:22                           Last log on time
  182.     209                             Log on count
  183.     0                               ?
  184.     0                               Total KB downloaded
  185.     34                              Download count
  186.     0                               Total KB uploaded
  187.     110                             Upload count
  188.     120                             Minutes per day
  189.     52                              Minutes remaining today
  190.     3                               Minutes used this call
  191.     32767                           Max. download KB per day
  192.     32767                           Remaining KB today
  193.     0                               KB downloaded today
  194.     00:36                           Current time on BBS
  195.     10-19-90                        Current date on BBS
  196.     Aardvark BBS                    BBS name
  197.     5059                            ?
  198.  
  199. Replies
  200. DDDDDDD
  201.  
  202.     Replies use a similar format, except the message number becomes the
  203.     conference number.  Also, the first record (up to 8 characters
  204.     starting on the first byte) in the reply file contains the BBS's ID.
  205.     This ID must much the one on the BBS in order for the mail door to
  206.     accept the replies.
  207.  
  208. Pointer files
  209. DDDDDDDDDDDDD
  210.  
  211.     *.PTR or *.PNT
  212.  
  213.     Don't bother with the pointer files, as the off-line reader has no
  214.     real use for it.  The mail doors send it so that the user will have
  215.     a copy of it, in case something on the BBS screws up.
  216.  
  217. Other files
  218. DDDDDDDDDDD
  219.  
  220.     Bulletins are sometimes send in the mail packet as well, this is
  221.     usually configurable by the user.  The files for the bulletins are
  222.     named:
  223.  
  224.         BLT-x.y
  225.  
  226.     where 'x' is the conference number, and 'y' is the bulletin number.
  227.  
  228.     New files are also configurable and can be sent by the mail door.
  229.     The file name for that is NEWFILES.DAT
  230. .
  231. Off-line mail door configuration
  232. DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
  233.  
  234.     For Qmail 4.0a:
  235.  
  236.         Send a private message addressed to "QMAIL" with a subject of
  237.         "CONFIG" (without quotes).  Then, enter any of the commands
  238.         listed below inside the text of your message.  Remember to use
  239.         one command per line.
  240.  
  241.         ADD <confnum>           Add a conference into the Qmail Door
  242.                                 4.00 scanning list. "YOURS" can also be
  243.                                 added to the command if the user wishes
  244.                                 to receive messages only addressed them.
  245.                                 Example: ADD 1 YOURS
  246.         DROP <confnum>          Drop a conference from the Qmail Door
  247.                                 4.00 scanning list.
  248.         RESET <confnum> <value> Resets a conference to a particular
  249.                                 value. The user can use "HIGH-xxx" to
  250.                                 set the conference to the highest
  251.                                 message in the base.
  252.         CITY <value>            Changes the "city" field in the User's
  253.                                 PCBoard entry.
  254.         PASSWORD <value>        Changes the user's login password.
  255.         BPHONE <value>          Business/data phone number
  256.         HPHONE <value>          Home/voice phone number
  257.         PCBEXPERT <on|off>      Turns the PCBoard EXPERT mode ON or OFF.
  258.         PCBPROT <value>         PCBoard file transfer protocol (A-Z).
  259.         PAGELEN <value>         Page length inside PCBoard.
  260.         PCBCOMMENT <value>      User maintained comment.
  261.         AUTOSTART <value>       Qmail Door autostart command.
  262.         PROTOCOL <value>        Qmail Door file transfer protocol (A-Z).
  263.         EXPERT <on|off>         Turns the Qmail Door EXPERT mode ON or
  264.                                 OFF.
  265.         MAXSIZE <value>         Maximum size of the user's .QWK packet
  266.                                 (in bytes)
  267.         MAXNUMBER <value>       Maximum number of messages per
  268.                                 conference.
  269.  
  270.     For MarkMail:
  271.  
  272.         Send a private message addressed to "MARKMAIL" with the subject
  273.         line of:
  274.  
  275.         "ADD" in the conference you want to add
  276.         "DROP" in the conference you want to drop
  277.         "YOURS" in the conference you want only your mail sent
  278.         "FILES ON" or "FILES OFF" in any conference to tell MarkMail
  279.             whether to scan for new files or not.
  280.         "BLTS ON" or "BLTS OFF" to turn on and off, respectively, of
  281.             receiving bulletins.
  282.         "OWN ON" or "OWN OFF" to turn on and off, respectively, of
  283.             receiving messages you sent
  284.         "DELUXE ON" or "DELUXE OFF" to turn on and off, respectively, of
  285.             receiving DeLuxe menu
  286.         "LIMIT size" to set the maximum size of MESSAGES.DAT file can
  287.             be, it cannot exceed what the Sysop has set up
  288.  
  289.         After "ADD" or "YOURS", you can also put in the message number
  290.         you want to reset the conference to; or you can enter a relative
  291.         number, i.e. -50, to reset the message pointer to the highest in
  292.         the conference minus 50.
  293.  
  294. Non-echoed messages
  295. DDDDDDDDDDDDDDDDDDD
  296.  
  297.     In order to send a non-echoed message (not send out to other BBSes),
  298.     a user can enter "NE:" in front of the subject line.  The MarkMail
  299.     door will strip this "NE:" and turn off the echo flag.
  300.  
  301. Taglines
  302. DDDDDDDD
  303.  
  304.     The most common format for a reader tag-line is:
  305.  
  306.     ---
  307.      ~ My reader v1.00 ~ The rest of the tag-line.
  308.  
  309.     The three dashes is called a tear-line.  The tag-line is appended to
  310.     the end of the message and is usually one line only.
  311.  
  312. DOOR.ID
  313. DDDDDDD
  314.  
  315.     DOOR = <doorname>
  316.  
  317.         This is the name of the door that created the QWK packet, i.e.
  318.         <doorname> = Tomcat.
  319.  
  320.     VERSION = <doorversion>
  321.  
  322.         This is the version number of the door that created the packet,
  323.         i.e. <doorversion> = 2.9.
  324.  
  325.     SYSTEM = <systemtype>
  326.  
  327.         This is the underlying BBS system type and version, i.e.
  328.         <systemtype> = Wildcat 2.55.
  329.  
  330.     CONTROLNAME = <controlname>
  331.  
  332.         This is the name to which the reader should send control
  333.         messages, eg. <controlname> = TOMCAT.
  334.  
  335.     CONTROLTYPE = <controltype>
  336.  
  337.         This can be one of ADD, DROP, or REQUEST (or others.)  ADD and
  338.         DROP are pretty obvious (they work as in MarkMail), and REQUEST
  339.         is for use with BBS systems that support file attachments.  Try
  340.         out SLMR with CONTROLTYPE = REQUEST and use the Q function.
  341.  
  342.     RECEIPT
  343.  
  344.         This flag indicates that the door/BBS is capable of return
  345.         receipts when a message is received.  If the first three letters
  346.         of the subject are RRR, then the door should strip the RRR and
  347.         set the 'return-receipt-requested' flag on the corresponding
  348.         message.
  349.  
  350.  
  351.  
  352.